package cn.edu.neusoft.neufooddemo.service;


import java.util.List;

import cn.edu.neusoft.neufooddemo.bean.CollectInfo;
import cn.edu.neusoft.neufooddemo.bean.LoginBean;
import cn.edu.neusoft.neufooddemo.bean.Result;
import cn.edu.neusoft.neufooddemo.bean.UserInfo;
import okhttp3.MultipartBody;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;

/**
 * Created by Shinelon on 2017/4/3.
 */

public interface UserService {
    @GET("userLogin.do")
    Call<LoginBean> login(
            @Query("username") String username,
            @Query("userpass") String userpass
    );

    @GET("userRegister.do")
    Call<Result> register(
            @Query("username") String username,
            @Query("userpass") String userpass,
            @Query("mobilenum") String mobilenum,
            @Query("address") String address,
            @Query("comment") String comment
    );

    @GET("updateUserById.do")
    Call<Result> updateUserById(
            @Query("user_id") String user_id,
            @Query("username") String username,
            @Query("userpass") String userpass,
            @Query("mobilenum") String mobilenum,
            @Query("address") String address
    );

    @GET("getUserById.do")
    Call<UserInfo> getUserById(
            @Query("user_id") String user_id
    );

    @GET("insertOrder.do")
    Call<Result> insertOrder(
            @Query("user_id") String user_id,
            @Query("food_id") String food_id,
            @Query("num") String num,
            @Query("sum") String sum,
            @Query("suggesttime") String suggesttime,
            @Query("address") String address
    );

    @GET("userCollectShop.do")
    Call<Result> userCollectShop(
            @Query("user_id") String user_id,
            @Query("shop_id") String shop_id
    );

    @GET("userCollectFood.do")
    Call<Result> userCollectFood(
            @Query("user_id") String user_id,
            @Query("food_id") String food_id
    );

    @GET("getAllUserCollection.do")
    Call<List<CollectInfo>> getAllUserCollection(
            @Query("user_id") String user_id,
            @Query("flag") String flag
    );
    @Multipart
    @POST("changeUserImg")
    Call<Boolean> changeUserImg(@Query("user_id") String user_id, @Part MultipartBody.Part file);

    @GET("insertOrder2.do")
    Call<Result> insertOrder2(
            @Query("user_id") String user_id,
            @Query("sum") String sum,
            @Query("suggesttime") String suggesttime,
            @Query("address") String address,
            @Query("items") String items
    );
}
